package com.loong.ems.mapper;

import com.loong.ems.domain.entity.EmpLeaveRecord;
import com.loong.ems.domain.vo.resp.EmpLeaveRecordVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author 龙勇-229970722
 * @date 2025-01-03 14:38
 * @description: 请假接口
 */

@Mapper
public interface EmpLeaveRecordMapper {
    /**
     * 获取请假记录列表
     * @return
     */
    List<EmpLeaveRecordVo> getLeaveRecordList();

    /**
     * 获取待审批请假记录列表
     * @return
     */
    List<EmpLeaveRecordVo> getPendingLeaveRecordList(@Param("status") Integer status);

    /**
     * 插入请假记录
     * @param empLeaveRecord
     * @return
     */
    int insert(@Param("empLeaveRecord") EmpLeaveRecord empLeaveRecord);

    /**
     * 删除请假记录
     * @param id
     * @return
     */
    int deleteById(@Param("id") Long id);

    /**
     * 请假人数统计
     * @return
     */
    int getCount();

    /**
     * 根据请假人Id获取请假记录列表
     * @return
     */
    List<EmpLeaveRecordVo> getLeaveRecordListByUserId(@Param("userId") Long userId);

    /**
     * 更新请假记录
     * @param empLeaveRecord
     * @return
     */
    int updateByPrimaryKeySelective(@Param("empLeaveRecord") EmpLeaveRecord empLeaveRecord);
}
